package com.atguigu.controller;

import com.atguigu.service.ConsumerService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author cyd
 * @version 1.0.0
 * @date 2021/11/15 9:17
 */
@RestController
public class ConsumerController {

    @Resource
    ConsumerService consumerService;

    @GetMapping("/consumer/hystrix/ok/{id}")
    public String paymentInfo_ok(@PathVariable("id") Integer id) {
        return consumerService.getPaymentInfo_ok(id);
    }

    @GetMapping("/consumer/hystrix/timeOut/{id}")
    public String paymentInfo_timeOut(@PathVariable("id") Integer id) {
        return consumerService.getPaymentInfo_timeOut(id);
    }
}
